import request from '@/utils/request'

// 查询代建计量列表
export function listMeterage(query) {
  return request({
    url: '/agency/meterage/list',
    method: 'get',
    params: query
  })
}

// 查询代建计量详细
export function getMeterage(masterId) {
  return request({
    url: '/agency/meterage/' + masterId,
    method: 'get'
  })
}

// 新增代建计量
export function addMeterage(data) {
  return request({
    url: '/agency/meterage',
    method: 'post',
    data: data
  })
}

// 修改代建计量
export function updateMeterage(data) {
  return request({
    url: '/agency/meterage',
    method: 'put',
    data: data
  })
}

// 删除代建计量
export function delMeterage(masterId) {
  return request({
    url: '/agency/meterage/' + masterId,
    method: 'delete'
  })
}

// 代建计量添加前的验证
export function beforeAddValidate() {
  return request({
    url: '/agency/meterage/validateBeforeMeterageIsWorkflowUser',
    method: 'get'
  })
}

// 传送
export function delivery(data) {
  return request({
    url: '/agency/meterage/delivery',
    method: 'post',
    data: data
  })
}

// 锁定
export function lock(masterId) {
  return request({
    url: '/agency/meterage/lock/' + masterId,
    method: 'get'
  })
}

// 解锁
export function unlock(masterId) {
  return request({
    url: '/agency/meterage/unlock/' + masterId,
    method: 'get'
  })
}
